package DataStructure.stack;


public interface MyStack<E>{

    E peek();

    void push(E e);

    E pop();

    int size();

    boolean isEmpty();

    void clear();

//SeqStack{e=[0,1,2,3,4,5,6,7,8,9], size=10}
//9
//8
//7
//6
//5
//SeqStack{e=[0,1,2,3,4], size=5}
//SeqStack{e=[100,101,102,103,104,105,106,107,108,109], size=10}
//109


    public static void main(String[] args) {
        MyStack<Integer> s=new LinkStack<>();
        for (int i = 0; i < 10; i++) {
            s.push(i);
        }
        System.out.println(s);
        for (int i = 0; i < 5; i++) {
            System.out.println(s.pop());
        }
        System.out.println(s);
        for (int i = 0; i < 10; i++) {
            s.pop();
        }
        for (int i = 0; i < 10; i++) {
            s.push(i+100);
        }
        System.out.println(s);
        System.out.println(s.peek());

    }
}
